package com.yyge.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yyge.common.vo.req.PageReq;
import com.yyge.common.vo.resp.PageResp;
import com.yyge.controller.admin.categoryclass.req.CategoryClassReq;
import com.yyge.controller.admin.categoryclass.resp.CategoryClassResp;
import com.yyge.entity.CategoryClass;
import com.yyge.service.CategoryClassService;
import com.yyge.mapper.CategoryClassMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【category_class(商品分类表)】的数据库操作Service实现
* @createDate 2023-07-02 20:36:22
*/
@Service
public class CategoryClassServiceImpl extends ServiceImpl<CategoryClassMapper, CategoryClass>
    implements CategoryClassService{
    @Autowired
    private CategoryClassMapper categoryClassMapper;

    @Override
    public PageResp search(CategoryClassReq req, PageReq<CategoryClass> vo) {
        List<CategoryClassResp> search = categoryClassMapper.search(req);
        PageResp pageResp=new PageResp<>();
        pageResp.setTotal(vo.getTotal());
        pageResp.setPageNum(vo.getPage());
        pageResp.setPageSize(vo.getSize());
        pageResp.setRows(search);
        return pageResp;
    }
}




